package com.ruoyi.project.newhope.setting.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.project.newhope.setting.domain.NewHopeSetting;
import com.ruoyi.project.newhope.setting.mapper.NewHopeSettingMapper;
import com.ruoyi.project.newhope.setting.service.INewHopeSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-02-08
 */
@Service
public class NewHopeSettingServiceImpl implements INewHopeSettingService
{
    @Autowired
    private NewHopeSettingMapper newHopeSettingMapper;

    /**
     * 查询用户
     * 
     * @param id 用户ID
     * @return 用户
     */
    @Override
    public NewHopeSetting selectNewHopeSettingById(Long id)
    {
        return newHopeSettingMapper.selectNewHopeSettingById(id);
    }

    /**
     * 查询用户列表
     * 
     * @param newHopeSetting 用户
     * @return 用户
     */
    @Override
    public List<NewHopeSetting> selectNewHopeSettingList(NewHopeSetting newHopeSetting)
    {
        return newHopeSettingMapper.selectNewHopeSettingList(newHopeSetting);
    }

    /**
     * 新增用户
     * 
     * @param newHopeSetting 用户
     * @return 结果
     */
    @Override
    public int insertNewHopeSetting(NewHopeSetting newHopeSetting)
    {
        newHopeSetting.setCreateTime(DateUtils.getNowDate());
        return newHopeSettingMapper.insertNewHopeSetting(newHopeSetting);
    }

    /**
     * 修改用户
     * 
     * @param newHopeSetting 用户
     * @return 结果
     */
    @Override
    public int updateNewHopeSetting(NewHopeSetting newHopeSetting)
    {
        newHopeSetting.setUpdateTime(DateUtils.getNowDate());
        return newHopeSettingMapper.updateNewHopeSetting(newHopeSetting);
    }

    /**
     * 删除用户对象
     * 
     * @param id 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteNewHopeSettingByIds(String id)
    {
        return newHopeSettingMapper.deleteNewHopeSettingByIds(Convert.toStrArray(id));
    }

    /**
     * 删除用户信息
     * 
     * @param id 用户ID
     * @return 结果
     */
    @Override
    public int deleteNewHopeSettingById(Long id)
    {
        return newHopeSettingMapper.deleteNewHopeSettingById(id);
    }

}
